package com.seasun.xg.claw;

import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

public final class StaticConfigurationProperties {
	public String confEnable;
	public String confHosts;
	public String confIgnores;
	public String appGroup;
	public String appName;
	public String appVersion;
	public String appProfile;

	public List<String> getConfHostsList() {
		return Arrays.asList(Optional.ofNullable(confHosts).orElse("").split(",")).stream()
				.filter(str -> !str.trim().isEmpty()).collect(Collectors.toList());
	}

	public List<String> getConfIgnoresList() {
		return Arrays.asList(Optional.ofNullable(confIgnores).orElse("").split(",")).stream()
				.filter(str -> !str.trim().isEmpty()).collect(Collectors.toList());
	}

	public boolean isEnable() {
		if ("true".equalsIgnoreCase(confEnable)) {
			return true;
		}

		return false;
	}
}
